#include<iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	for(int a=1;a*a<=n;a++){
		for(int b=a+1;a*a+b*b<=n;b++){
			for(int c=b+1;a*a+b*b+c*c<=n;c++){
				if(a*a+b*b+c*c==n){
					cout << a << " " << b << " " << c << endl;
				}
			}
		}
	}
	return 0;
} 
